import request from '@/utils/request'

export function getCustomerList(query) {
	return request({
		url: "/customer/getList",
		method: "get",
		params: query
	})
}

export function queryByPage(query) {
	return request({
		url: "/customer/queryByPage",
		method: "get",
		params: query
	})
}

export function insert(data) {
	return request({
		url: "/customer/insert",
		method: 'post',
		data: data
	})
}

export function update(data) {
	return request({
		url: "/customer/update",
		method: "post",
		data: data
	})
}

export function delByIds(ids) {
  return request({
    url: "/customer/delByIds/" + ids,
    method: "post"
  })
}

// 重置密码
export function resettingPassword(query) {
  return request({
    url: '/customer/resettingPassword',
    method: 'post',
    params: query
  })
}

// 授权
export function insertAuthorize(query) {
	return request({
		url: '/customer/insertAuthorize',
		method: 'post',
		params: query
	})
}

// 查询已授权的厂别
export function getCustomerPlantListByCustomerId(query) {
	return request({
		url: '/customer/getCustomerPlantListByCustomerId',
		method: 'get',
		params: query
	})
}

// 切换操作状态
export function changeOperate(query) {
	return request({
		url: '/customer/changeOperate',
		method: 'post',
		params: query
	})
}

//是否通用仓库
export function changeIsGeneralStore(query) {
	return request({
		url: '/customer/changeIsGeneralStore',
		method: 'post',
		params: query
	})
}